"""
kafka消费者
"""
import json

from kafka import KafkaConsumer

res = KafkaConsumer("yjf", bootstrap_servers='10.90.93.29:9092',group_id="y")
print('customer2消费者连接服务器成功')
for data in res:
    receive_value = json.loads(data.value.decode('utf-8'))
    print("topic=%s partition=%d offset=%d value=%s" % (data.topic, data.partition, data.offset, receive_value))
